import Vue from "vue";
import Router from "vue-router";

import index from "@/pages/index"; //首页
import feature from "@/pages/feature"; //功能页
import Dingdan from "@/pages/Dingdan";
import Faxian from "@/pages/Faxian";
import Wode from "@/pages/Wode";
import login from "@/pages/login";
// 功能块
import newsDetail from "@/pages/detailPage/newsDetail";
import lifeServeDetail from "@/pages/detailPage/lifeServeDetail";
import mapDetail from "@/pages/detailPage/mapDetail";
import dealDetail from "@/pages/detailPage/dealDetail";
import scheduleDetail from "@/pages/detailPage/scheduleDetail";
import scheduleList from "@/pages/detailPage/scheduleList";
import scoreDetail from "@/pages/detailPage/scoreDetail";
import phoneDetail from "@/pages/detailPage/phoneDetail";
import academicDetail from "@/pages/detailPage/academicDetail";
import academicArticle from "@/pages/detailPage/academicArticle";
import carListDetail from "@/pages/detailPage/carListDetail";
import carList from "@/pages/detailPage/carList";
import flowDetail from "@/pages/detailPage/flowDetail";
import jobsDetail from "@/pages/detailPage/jobsDetail";
import jobArticle from "@/pages/detailPage/jobArticle";

//新闻文章
import newsArtical1 from "@/pages/detailPage/newsArtical1";
import newsArtical2 from "@/pages/detailPage/newsArtical2";
import newsArtical3 from "@/pages/detailPage/newsArtical3";

//功能详情
import scoreList from "@/pages/detailPage/scoreList";
import loginScore from "@/pages/detailPage/loginScore";

import loginFlow from "@/pages/detailPage/loginFlow";
import FlowList from "@/pages/detailPage/FlowList";

import MintPull from "@/pages/MintPull";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/index"
    },
    {
      name: "index",
      path: "/index",
      component: index,
      meta: {
        title: "西电主页",
        keepAlive: true
      }
    },
    {
      name: "faxian",
      path: "/faxian",
      component: Faxian,
      meta: {
        title: "发现"
      }
    },
    {
      name: "wode",
      path: "/wode",
      component: Wode,
      meta: {
        title: "我的"
      }
    },

    //首页跳转向的路由
    {
      path: "/index/feature", //功能详情页
      component: feature
    },
    {
      name: "login", //登录页
      path: "/login",
      component: login,
      children: [
        {
          name: "mintPull",
          path: "mint-pull",
          component: MintPull
        }
      ]
    },

    // 功能块开始
    {
      name: "newsDetail", //新闻页
      path: "/index/newsDetail",
      component: newsDetail
    },
    {
      name: "mapDetail", //地图
      path: "/index/mapDetail",
      component: mapDetail
    },
    {
      name: "dealDetail", //校园交易
      path: "/index/dealDetail",
      component: dealDetail
    },
    {
      name: "scheduleDetail", //课表
      path: "/index/scheduleDetail",
      component: scheduleDetail
    },
    {
      name: "scheduleList", //课表
      path: "/index/scheduleDetail/scheduleList",
      component: scheduleList
    },
    {
      name: "lifeServeDetail", //生活服务
      path: "/index/lifeServeDetail",
      component: lifeServeDetail
    },
    {
      name: "phoneDetail", //电话薄
      path: "/index/phoneDetail",
      component: phoneDetail
    },
    {
      name: "academicDetail", //学术讲座
      path: "/index/academicDetail",
      component: academicDetail,
      meta: {
        keepAlive: true
      }
    },
    {
      name: "academicArticle", //学术讲座详情
      path: "/index/academicDetail/academicArticle",
      component: academicArticle,
      meta: {
        keepAlive: true
      }
    },
    {
      name: "carListDetail", //校车时刻
      path: "/index/carListDetail",
      component: carListDetail
    },
    {
      name: "carList", //校车时刻详情
      path: "/index/carListDetail/carList",
      component: carList
    },
    {
      name: "scoreDetail", //成绩查询
      path: "/index/scoreDetail",
      component: scoreDetail,
      redirect: "/index/scoreDetail/loginScore",
      children: [
        {
          path: "scoreList",
          component: scoreList
        },
        {
          path: "loginScore",
          component: loginScore
        }
      ]
    },
    {
      path: "/index/flowDetail", //流量查询
      component: flowDetail,
      redirect: "/index/flowDetail/loginFlow",
      children: [
        {
          path: "loginFlow",
          component: loginFlow
        },
        {
          path: "FlowList",
          component: FlowList
        }
      ]
    },

    {
      path: "/index/jobsDetail", //校园招聘
      component: jobsDetail
    },
    {
      name: "jobArticle", //校园招聘详情
      path: "/index/jobsDetail/jobArticle",
      component: jobArticle
    },
    // 功能块结束
    //新闻文章列表开始
    {
      name: "newsArtical1",
      path: "/index/newsArtical1",
      component: newsArtical1
    },
    {
      name: "newsArtical2",
      path: "/index/newsArtical2",
      component: newsArtical2
    },
    {
      name: "newsArtical3",
      path: "/index/newsArtical3",
      component: newsArtical3
    }
    //新闻文章列表结束
  ]
});
